<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>喜乐康智能家居系统</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="<%=basePath%>js/jquery-1.4.2.js"></script>
	<script type="text/javascript" src="<%=basePath%>js/ibuilding.js"></script>
	<script type="text/javascript" src="<%=basePath%>js/jquery.json-2.2.min.js"></script>
	<script type="text/javascript" src="<%=basePath%>js/util.js"></script>
	<link rel="stylesheet" type="text/css" href="<%=basePath%>themes/icon.css">
	
	<link rel="stylesheet" type="text/css" href="<%=basePath%>css/clock/clock.css">
	
	
  	<link rel="stylesheet" type="text/css" href="<%=basePath%>css/ibuilding.css">
  	<script type="text/javascript">
  	var mainSceneId = '<s:property value="mainSceneId"/>';
  	var mainSceneTime=decodeURI('<s:property value="mainSceneTime"/>');
  	var sceneIsOpen = '<s:property value="sceneIsOpen"/>';
  	var sceneTime='<s:property value="sceneTime"/>';
  	var sceneSceneId ='<s:property value="currentSceneId"/>';
  	
  	$(function(){
  		$.ajaxSetup({async: false});
  		showMainLeftTime();
  		scenePage(1,'up');
  		queryDevice('up');
  		if(mainSceneId!=''){
			var yyyyMMddmm = mainSceneTime.split("-");
			$(".main_open_scene").text("${scene.sceneName}"+"  "+yyyyMMddmm[0]+"年"+yyyyMMddmm[1]+"月"+yyyyMMddmm[2]+"日"+yyyyMMddmm[3]+"时"+yyyyMMddmm[4]+"分  "+"开启");
  		}
  		
  	});

  	function leftTab(type){
  		$(".main_left_menu ul li").attr("class","main_left_menu_ul_li");
		$("#main_left_menu_ul_li"+type).attr("class","main_left_menu_ul_li_press");
		$("#mainLeftMenuImgScene").attr("class","main_left_menu_img main_left_menu_img_scene");
		$("#mainLeftMenuImgDevice").attr("class","main_left_menu_img main_left_menu_img_device");
		$("#mainLeftMenuImgSetting").attr("class","main_left_menu_img main_left_menu_img_setting");
		switch(type){
			case 1:
				$("#mainLeftMenuImgScene").attr("class","main_left_menu_img_press main_left_menu_img_scene_press");
				$("#mainRight").load(evn_Path+"scene.do?sceneSceneId="+mainSceneId);
				break;
			case 2:
				$("#mainLeftMenuImgDevice").attr("class","main_left_menu_img_press main_left_menu_img_device_press");
				$("#mainRight").load(evn_Path+"device.do");
				break;
			case 3:
				$("#mainLeftMenuImgSetting").attr("class","main_left_menu_img_press main_left_menu_img_setting_press");
				$("#mainRight").load(evn_Path+"setting.do");
				break;
		}
  	 }
  	</script>
  	
  </head>
  
  <body class="main_body">
  	<div class="main_background">
  		<div class="main_left">
  			<div class="main_left_logo"></div>
  			<div class="main_left_menu">
  				<ul>
  					<li class="main_left_menu_ul_li" id="main_left_menu_ul_li1"  onclick="leftTab(1)">
  						<div class="main_left_menu_img main_left_menu_img_scene" id="mainLeftMenuImgScene">
  							场景
  						</div>
  					</li>
  					<li class="main_left_menu_ul_li" id="main_left_menu_ul_li2" onclick="leftTab(2)">
  						<div class="main_left_menu_img main_left_menu_img_device" id="mainLeftMenuImgDevice">
  							面板
  						</div>
  					</li>
  					<li class="main_left_menu_ul_li" id="main_left_menu_ul_li3" onclick="leftTab(3)">
  						<div class="main_left_menu_img main_left_menu_img_setting" id="mainLeftMenuImgSetting">
  							设置
  						</div>
  					</li>
  				</ul>
  			</div>
  			<div class="main_left_menu_openClose">
  				<ul>
  					<li onclick="sceneAll('allOpen');">
  						<div class="main_left_menu_close" >
  							<img id="allOpenImg" src="<%=basePath%>resource/main_left_menu_close.png" />
  						</div>
  						<span class="main_left_menu_close_text">
  							全开
  						</span>
  					</li>
  					<li onclick="sceneAll('allClose');">
  						<div class="main_left_menu_close" >
  							<img id="allCloseImg" src="<%=basePath%>resource/main_left_menu_close.png" />
  						</div>
  						<span class="main_left_menu_close_text">
  							全关
  						</span>
  					</li>
  				</ul>
  			</div>
  			<div style="width: 100%;text-align: center;font-weight: bold;" id="mainLeftTime">
  			</div>
  			
  		</div>
  		<div class="main_right" id="mainRight">
  			<div class="main_right_content">
				<div id="clock">
				<ul>
					<li id="hour"></li>
					<li id="minutes"></li>
					<li id="seconds"></li>
				</ul>
			</div>
			<script type="text/javascript" src="<%=basePath%>js/clock.js"></script>
				<div class="main_open_scene">
					无场景
				</div>
				<div id="main_scene">
					
				</div>
			</div>
			<div id="main_device">
				
			</div>
  		</div>
  	</div>
  </body>
</html>
